package edu.washington.cs.sounddetector.server.api;

/**
 * <p>
 * Method is an interface that signifies a method that can be requested to be run against the
 * server. Implementations of the Method interface are simple, immutable data objects that hold all
 * the necessary information for a certain method. The actual logic of these methods is put in a
 * separate MethodLogic subclass, and the result of executing a method is put in yet another
 * separate class: a subclass of MethodResult.
 * </p>
 * 
 * <p>
 * The reason for this separation is so that Method objects can easily be shared by the server and
 * its clients without introducing unnecessary dependencies on internal server classes.
 * </p>
 * 
 * <p>
 * Implementing a new Method is unfortunately fairly involved, so the steps are outlined below:
 * <ol>
 * <li>Come up with a name for your method, figure out what it will do, and figure out all the
 * potential error cases that you will be able to detect.</li>
 * <li>For each error case that you can detect, check if it is in MethodResult.FailureReason, and
 * add it if necessary.</li>
 * <li>Write the Method data object. This is an implementation of this interface and should be a
 * simple, immutable data object with getters for each of it's fields. Also, try to implement
 * toString, equals, and hashCode.</li>
 * <li>Write the {@link MethodResult} object. This is a subclass of {@link MethodResult}, please
 * read the documentation in that class for details on subclassing it.</li>
 * <li>Write the logic for your method. This should go in either {@link WriteLogic},
 * {@link ReadLogic}, or {@link DeleteLogic}, depending on if you write, read, or delete data in the
 * database.</li>
 * <li>In {@link MethodLogic}, add a constant to {@link MethodLogic.MethodType} for your method.
 * Then add this constant and your method to the MethodLogic.methodClassMap. Finally, in
 * {@link MethodLogic#execute}, add a case to the switch statement for your method, follow the
 * pattern of all the other cases.</li>
 * <li>In {@link MethodConverter}'s constructor, add your Method to the methodMap. Follow the
 * pattern of the other methods.</li>
 * <li>You're done!</li>
 * </ol>
 * </p>
 * 
 * @author the.dylan.price@gmail.com
 */
public interface Method
{
}
